<timer> element

The <timer> element provides a method for invoking a task automatically after some period of user inactivity. Any task or user action that activates the card starts the timer, and executing any task element stops it. You can only associate one task per timer, and you can only define one timer per card.

Syntax

Attributes

 
name The name of the variable in which the device stores the timer value. If the variable has no value when the timer is initialized, the device sets it to the value specified for the default attribute. The device sets this variable to either the current timer value when the user exits the card or 0 if the timer expires. 
value A string specifying the value for the variable specified by the key attribute. You must specify <timer> values in units of 1/10 seconds--so, for example, a value of 100 equals 10 seconds. Specifying a value of 0 disables the timer. 

If the name attribute already has a value when the timer is initialized, the device ignores the default attribute. If the name attribute does not already have a value, the device sets it to the value specified by the value attribute. 


 

Example

The following example illustrates how a timer can initialize and reuse a counter. The device resets the timer to the value of the time variable each time the user navigates to the card. If time has no value, the device sets the timer to 5 seconds. When the timer expires, the device automatically displays the second card in the deck.